#!/usr/bin/env bash


#-serial stdio   

cmd="\
time \
./buildroot/output.arm~/host/usr/bin/qemu-system-arm \
-M versatilepb \
-append 'root=/dev/sda nokaslr norandmaps printk.time=y - lkmc_eval=\"/rand_check.out;wget -S google.com;/poweroff.out;\"' \
-kernel ./buildroot/output.arm~/images/zImage \
-dtb ./buildroot/output.arm~/images/versatile-pb.dtb \
-nographic \
\
-drive file=./buildroot/output.arm~/images/rootfs.ext2,if=scsi,id=img-direct,format=raw \
-drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay \
-device scsi-hd,drive=img-blkreplay \
\
-netdev user,id=net1 \
-device rtl8139,netdev=net1 \
-object filter-replay,id=replay,netdev=net1 \
"
echo "$cmd"
#eval "$cmd -icount 'shift=7,rr=record,rrfile=replay.bin'"
# Different than previous.
eval "$cmd -icount 'shift=7,rr=record,rrfile=replay.bin'"
# Same as previous.
eval "$cmd -icount 'shift=7,rr=replay,rrfile=replay.bin'"
#eval "$cmd -icount 'shift=7,rr=replay,rrfile=replay.bin' -S -s"
